home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 2 / CD ACTUAL VOL 2.iso / docs / slack-do / bind / readme < prev   
Encoding:
Text File  |  1995-09-10  |  13.8 KB  |  359 lines

  1. 28/07/95  v3.0    README3: A LINUX-TO-DEMON-INTERNET CONFIGURATION GUIDE
  2.  
  3.        BIND: RUNNING A NAME SERVER UNDER SLACKWARE LINUX WITH DIS 
  4.        ==========================================================
  5.  
  6.      Copyright 1994-5 John A. Phillips.      john@linux.demon.co.uk
  7.  
  8. Please note that I don't really understand everything here, so some of the
  9. stuff below may be a little off-beam, but it works (so far) for me. Comments
  10. are welcome.  As usual, use this information here at your own risk.
  11.  
  12. Some of the files you need to install or modify are contained in the
  13. package, for you to copy directly into place.  See the list at the end of
  14. this README.  Configuration should be done as user "root".
  15.  
  16.  
  17. 3A Requirements and installation notes
  18. --------------------------------------
  19. From amongst the optional packages of disk set N, these are required for
  20. basic network set-up.  Other packages from disk set N may be needed in the
  21. other packages in this guide.  Please see the relevant README(s).
  22.  
  23.     bind        Required.  This is the name server package.
  24.  
  25. NOTE 1:  The name server in this package will be of little use in saving 
  26. network traffic for name resolution if you re-boot your machine very 
  27. frequently (about as often as you log in to Demon).  The name server cache 
  28. is lost on shut-down and has to be re-generated from the network.
  29.  
  30. NOTE 2:  Off-line, processes such as mail and news posting may take longer 
  31. to complete when you run a local name server, as name server time outs seem 
  32. to take longer.
  33.  
  34. NOTE 3:  When running named I notice problems with netdate failing when the 
  35. clock is being adjusted by setclock in the BASE package.  A cure is to 
  36. do a "nslookup ntp.demon.co.uk" whilst on line (assuming this is your ntp 
  37. server).  This caches the name and IP address.  Otherwise, set the ntp 
  38. server in setclock to another Demon machine, such as demon-du.demon.co.uk.
  39.  
  40.  
  41. 3B The simplest possible set-up
  42. -------------------------------
  43. This is a  very simple cache-only client.  It is not authoritative at all
  44. (not even over localhost and 127.0.0.1).  I have been told this is a
  45. security risk (but not why).  However, it works.
  46.  
  47. Section 3C adds the SOA (Start of Authority) records for localhost and
  48. 127.0.0.1.  I recommend that you do this on the assumption that the advice
  49. I've heard about security is accurate.
  50.  
  51. Create directory /var/named (this is FSSTND compliant), and set up
  52. /etc/named.boot (or copy it in place from named.boot1 in the package):
  53.  
  54.  
  55. ; /etc/named.boot: boot file for name server
  56. ;
  57. directory /var/named
  58. ;
  59. ; type        domain            source file or host
  60. ;----------------------------------------------------------
  61. ;
  62. cache        .            named.root
  63. forwarders    158.152.1.65    158.152.1.193    192.68.174.95
  64.  
  65.  
  66. This file says that further configuration files are to be found in
  67. /var/named; that named.root contains "hints" about where to look things up
  68. (the "root" nameservers); and that the nameservers in the forwarders line
  69. (the demon nameservers) should be asked first if the cache does not contain
  70. the name being looked up.
  71.  
  72. It is perfectly ok to leave out the forwarders line.  The root nameservers
  73. will be asked first for the answers to queries about names.  As the cache of
  74. names builds up, including nameserver entries, I think that more appropriate
  75. nameservers will subsequently be asked for information.
  76.  
  77. However including the forwarders line makes your system behave exactly like
  78. a system using the demon nameservers via the list in resolv.conf, except
  79. that the answers are cached, and the root nameservers are available as a
  80. backup.
  81.  
  82. Set up /var/named/named.root thus (or copy it into place from the package):
  83.  
  84.  
  85. ;
  86. ;       This file holds the information on root name servers needed to
  87. ;       initialize cache of Internet domain name servers 
  88. ;       (e.g. reference this file in the "cache  .  <file>"
  89. ;       configuration file of BIND domain name servers).
  90. ;
  91. ;       This file is made available by InterNIC registration services
  92. ;       under anonymous FTP as
  93. ;           file                /domain/named.root
  94. ;           on server           FTP.RS.INTERNIC.NET
  95. ;       -OR- under Gopher at    RS.INTERNIC.NET
  96. ;           under menu          InterNIC Registration Services (NSI)
  97. ;              submenu          InterNIC Registration Archives
  98. ;           file                named.root
  99. ;
  100. ;       last update:    Oct 5, 1994
  101. ;       related version of root zone:   1994100500
  102. ;
  103. .                        99999999 IN  NS    NS.INTERNIC.NET.
  104. NS.INTERNIC.NET.         99999999     A     198.41.0.4
  105. .                        99999999     NS    NS1.ISI.EDU. 
  106. NS1.ISI.EDU.             99999999     A     128.9.0.107
  107. .                        99999999     NS    C.PSI.NET.
  108. C.PSI.NET.               99999999     A     192.33.4.12
  109. .                        99999999     NS    TERP.UMD.EDU.
  110. TERP.UMD.EDU.            99999999     A     128.8.10.90
  111. .                        99999999     NS    NS.NASA.GOV.
  112. NS.NASA.GOV.             99999999     A     128.102.16.10
  113.                          99999999     A     192.52.195.10
  114. .                        99999999     NS    NS.ISC.ORG.
  115. NS.ISC.ORG.              99999999     A     192.5.5.241
  116. .                        99999999     NS    NS.NIC.DDN.MIL.
  117. NS.NIC.DDN.MIL.          99999999     A     192.112.36.4
  118. .                        99999999     NS    AOS.ARL.ARMY.MIL.
  119. AOS.ARL.ARMY.MIL.        99999999     A     128.63.4.82
  120.                          99999999     A     192.5.25.82
  121. .                        99999999     NS    NIC.NORDU.NET.
  122. NIC.NORDU.NET.           99999999     A     192.36.148.17
  123. ; End of File
  124.  
  125.  
  126. These are the top-level (root-domain) nameservers for the 'net.  The latest
  127. version of this file can be found on ftp.rs.internic.net in file
  128. /domain/named.root.
  129.  
  130. Uncomment the "named" stanza in /etc/rc.d/rc.inet2 to run named at boot
  131. time.
  132.  
  133.     ...
  134.     # Start the NAMED/BIND name server.
  135.     if [ -f ${NET}/named ]
  136.     then
  137.      echo -n " named"
  138.      ${NET}/named
  139.     fi
  140.     ...
  141.  
  142. Make sure /etc/host.conf is like this:
  143.  
  144.     order hosts, bind
  145.     multi on
  146.  
  147. This makes sure the look-up for 127.0.0.1 or localhost is satisfied from
  148. /etc/hosts (see below), because the cache-only non-authoritative nameserver
  149. (in this section) will not even answer this query.  If you have the dummy
  150. interface in the kernel and it is set up in rc.inet1, this will also allow
  151. /etc/hosts to resolve your own IP address and hostname queries as well even
  152. when you are not connected.
  153.  
  154. Make sure /etc/hosts has at least these entries (configured for your own
  155. hostname and IP address):
  156.  
  157.     # For looping back.
  158.     127.0.0.1    localhost
  159.  
  160.     # This machine.
  161.     158.152.XXX.YYY    <YOUR_HOST_NAME>.demon.co.uk    <YOUR_HOST_NAME>
  162.  
  163.     # A router.
  164.     158.152.1.222    demon-du.demon.co.uk        demon-du
  165.  
  166. If you have other demon machines in here, you can remove them, as named will
  167. put them into its cache and remember them for you.  If you keep names and
  168. addresses here, they will be used before the names and addresses in the
  169. cache (see /etc/host.conf), and any updates will not be automatically made. 
  170. Just keep the router (now demon-du, I believe) if you are using DIP/CSLIP. 
  171. PPP doesn't need it.
  172.  
  173. Some people have said that they prefer to leave key machine names in
  174. /etc/hosts because this speeds things up a bit.  Fair enough.  You can do
  175. this if you want.  If the machine addresses ever change (which may be
  176. unlikely for important machines), you can update them manually.
  177.  
  178. Make sure /etc/resolv.conf is like this:
  179.  
  180.     search demon.co.uk
  181.     nameserver 127.0.0.1
  182.  
  183. The first line could be "search ." or "domain demon.co.uk" - see "man 5 
  184. resolver" for the differences in name look-up behaviour.  I prefer "search 
  185. . demon.co.uk", which looks up names as you supply them first, then tries 
  186. adding .demon.co.uk if the first look-up fails.  This, and the search line
  187. suggested in the example above, allow you to use "ping gate" for example,
  188. rather than having to use "ping gate.demon.co.uk".
  189.  
  190. The second line just points to the named on your own host as your system's
  191. name server.  I think other name servers (up to two more) could be added
  192. after "nameserver 127.0.0.1", and will be used in the event that your named
  193. goes down, but I haven't tried this.
  194.  
  195. That's it!  Reboot now or run named manually.
  196.  
  197. You can't for now run nslookup (to make manual queries about names) on your
  198. machine whilst it's not on the net, since nslookup does not seem to go
  199. through the resolver library, and named seems to need to resolve localhost
  200. and/or 127.0.0.1 first in order to work with nslookup.  However calls via
  201. the resolver library (e.g. from "telnet localhost" or "ftp 127.0.0.1") will
  202. work through the resolver library asking /etc/hosts.
  203.  
  204. Errors and other informative comments from named are logged in the file
  205. /var/adm/syslog.
  206.  
  207. You can cause a running named to re-load its configuration files with
  208.  
  209.     killall -HUP named
  210.  
  211. The command /usr/sbin/named.reload does the same and could be used instead.
  212.  
  213. You can cause the current data cache and hints to be dumped to the file
  214. /var/tmp/named_dump.db with the command
  215.  
  216.     killall -INT named
  217.  
  218. It is instructive to do this and see the dump file on a newly started named,
  219. and then after a simple connection to Demon, and then again after a few FTPs
  220. to sites around the world.
  221.  
  222. A further command /usr/sbin/named.restart is also available to kill and then
  223. re-start named if you wish to do this.
  224.  
  225.  
  226. 3C Adding SOA records for localhost and 127.0.0.1
  227. -------------------------------------------------
  228. This section adds the bits to run a named that is basically a cache-only
  229. client but is authoritative over localhost (and 127.0.0.1).  The set-up is
  230. said to be more secure than the basic set-up in section 3B.
  231.  
  232. The set-up is installed as in section 3B, above, with the extras explained
  233. below.  I recommend you to follow this section as well.
  234.  
  235. Add a couple of extra lines (those starting with "primary") to the original
  236. /etc/named.boot to make it look like this (or install the named.boot file
  237. from the package as /etc/named.boot):
  238.  
  239.  
  240. ; /etc/named.boot: boot file for name server
  241. ;
  242. directory /var/named
  243. ;
  244. ; type        domain            source file or host
  245. ;----------------------------------------------------------
  246. ;
  247. cache        .            named.root
  248. primary        localhost        named.hosts
  249. primary        0.0.127.IN-ADDR.ARPA    named.local
  250. forwarders    158.152.1.65    158.152.1.193    192.68.174.95
  251.  
  252.  
  253. Create /var/named/named.hosts like this (or copy the file in the package
  254. into place):
  255.  
  256.  
  257. ; /var/named/named.hosts: local host
  258. ; origin is localhost. (see named.boot)
  259. ;
  260. @        IN    SOA    <HOST>.demon.co.uk. <NAME>.<HOST>.demon.co.uk. (
  261.                 94122401    ; serial number
  262.                 86400        ; refresh:    24 hours
  263.                 3600        ; retry:    1 hour
  264.                 3600000        ; expire:    42 days (approx)
  265.                 604800    )    ; minimum:    1 week
  266.         IN    NS    localhost.
  267. localhost.    IN    A    127.0.0.1
  268.  
  269.  
  270. Configure <HOST> as your hostname, <NAME> as your local e-mail address, as
  271. appropriate (this entry should look like an Internet e-mail address with the
  272. "@" replaced by ".".  Watch for the "."s at the end of names.  They are
  273. important.
  274.  
  275. How do you choose the timeouts etc?  I copied them from examples.  Any
  276. comments would be welcome.
  277.  
  278. Create /var/named/named.local like this (or copy it into place from the
  279. package):
  280.  
  281.  
  282. ; /var/named/named.local: reverse mapping of 127.0.0
  283. ; origin is 0.0.127.in-addr.arpa. (see named.boot)
  284. ;
  285. @        IN    SOA    <HOST>.demon.co.uk. <NAME>.<HOST>.demon.co.uk. (
  286.                 94122401    ; serial number
  287.                 360000        ; refresh:    100 hours
  288.                 3600        ; retry:    1 hour
  289.                 3600000        ; expire:    42 days (approx)
  290.                 360000    )    ; minimum:    100 hours
  291.         IN    NS    localhost.
  292. 1        IN    PTR    localhost.
  293.  
  294.  
  295. Configure <HOST> as your hostname, <NAME> as your local e-mail address, as
  296. appropriate (this entry should look like an Internet e-mail address with the
  297. "@" replaced by ".".  Watch for the "."s at the end of names.  They are
  298. important.
  299.  
  300. How do you choose the timeouts etc?  I copied them from examples.  Again any
  301. comments would be welcome.
  302.  
  303. That's it.  Start or re-start named.  
  304.  
  305. Now it is possible to have "order bind, hosts" in /etc/host.conf (if you
  306. want).  This allows /etc/hosts to be kept as a back-up rather than consulted
  307. first.  Actually I currently run my server as in section 3C, but I still use
  308. "order hosts, binds", and a vestigial /etc/hosts file just like the one in
  309. section 3B.
  310.  
  311. By the way, some people have advised me to be authoritative over
  312. localhost.demon.co.uk.  However I have checked that Demon's nameservers
  313. return the correct answer for this name (127.0.0.1), which is then cached. 
  314. However, Demon's name servers certainly do not recognize just localhost.
  315.  
  316.  
  317. 3D  Conclusion
  318. --------------
  319. That's how it works for me.  As I said, I don't understand a lot of the
  320. "why's" yet, but the "how's" are in principle sorted (in the two simplest
  321. cases anyway).  I recommend Olaf Kirch's Linux Network Administration Guide
  322. (superb in general), but supplemented by something like the Sun Answerbook
  323. chapter 17, which for me sorted out a great deal of my confusion over named. 
  324. The O'Reilly book on DNS and BIND is also a good source of information.
  325.  
  326. To return to using Demon's name servers, /etc/resolv.conf and /etc/host.conf 
  327. should be restored to their original configurations from the BASE package.  
  328. If you want to make this permanent, you should also stop named from being 
  329. run by /etc/rc.d/rc.inet2, and kill the current process.  The configuration 
  330. files may be left in place.
  331.  
  332.  
  333. 3E  Bugs
  334. --------
  335. I still get occasional entries in /var/adm/syslog of the sort:
  336.  
  337.     Sep  3 05:04:25 linux named[47]: recvfrom: Connection refused
  338.  
  339. I believe this is cured by getting the latest bind package.
  340.  
  341.  
  342. 3F  Acknowledgments
  343. --------------------
  344. Thanks to John Man (jman@home.org) for helpful comments.
  345.  
  346.  
  347. 3F Files in this package
  348. ------------------------
  349.  
  350. File name (Slackware)                    Location in this package
  351. =====================                    ========================
  352. /var/named/named.root                    bind/named.root
  353. /var/named/named.local                   bind/named.local
  354. /var/named/named.hosts                   bind/named.hosts
  355. /etc/named.boot                          bind/named.boot1     (section 3B)
  356. /etc/named.boot                          bind/named.boot      (section 3C)
  357.  
  358. END OF README3
  359.